﻿using Autofac;
using Smart.Admin.Domain.GlobalVar;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using System.Data.Common;
using System.Linq;
using System.Net.Http;
using System.Xml.Linq;

namespace Smart.Admin.Domain.Service
{
    public class EmployeeExtensions
    {
        private readonly IHttpContextAccessor _httpContext;
        public EmployeeExtensions()
        {
            _httpContext = AutofacVar.container.Resolve<IHttpContextAccessor>();
        }
        /// <summary>
        /// 员工编号
        /// </summary>
        public string EmployeeId
        {
            get
            {
                return _httpContext.HttpContext.User.Claims.ToList().FirstOrDefault(m => m.Type.Contains("Id"))?.Value??"";
            }
        }
    }
}
